package views;

import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class ProjectView 
{
    private static final long serialVersionUID = 1L;

    private JFrame jFrame = null;  //  @jve:decl-index=0:visual-constraint="10,10"

    private JPanel jContentPane = null;

    private JLabel headingLabel = null;
   
    private JLabel headingLabel_2 = null;
   
    private JLabel headingLabel_3 = null;
   
    private JLabel headingLabel_4 = null;
   
    private JLabel headingLabel_5 = null;
   
    private JLabel headingLabel_6 = null;
   
    private JLabel headingLabel_7 = null;
   
    private JLabel headingLabel_8 = null;
   
    private JLabel headingLabel_9 = null;
   
    private JLabel headingLabel_10 = null;
   
    private JLabel headingLabel_11 = null;
   
    private JLabel headingLabel_12 = null;
   
    private JTextField project_id_TextField = null;
   
    public JTextField getProjectId()
    {
    	return project_id_TextField;
    }
    
    private JTextField title_TextField = null;

    public JTextField getProjectTitle()
    {
    	return title_TextField;
    }

    private JTextField date_created_TextField = null;
   
    public JTextField getDateCreated()
    {
    	return date_created_TextField;
    }
    
    private JTextField creator_TextField = null;
   
    public JTextField getCreator()
    {
    	return creator_TextField;
    }
    private JTextField number_milestones_TextField = null;
    
    public JTextField getNumMilestones()
    {
    	return number_deliverables_TextField;
    }
    
    private JTextField number_deliverables_TextField = null;
   
    public JTextField getNumDeliverables()
    {
    	return number_deliverables_TextField;
    }
    
    private JList staff_List = null;
   
    private JList milestones_List = null;
   
    private JList deliverables_List = null;
    public JList getDeliverables()
    {
    	return deliverables_List;
    }
    private JTextArea additionalnotesTextArea = null;
   
    public JTextArea getAdditionalNotes()
    {
    	return additionalnotesTextArea;
    }
    private JScrollPane scrollPane = null;
   
    private JButton addstaffButton = null;
   
    private JButton removestaffButton = null;
   
    private JButton addmilestoneButton = null;
   
    private JButton removemilestoneButton = null;
   
    private JButton adddeliverableButton = null;
   
    private JButton removedeliverableButton = null;
   
    private JButton saveButton = null;
   
    public JButton getBtSave()
    {
    	return saveButton;
    }
    private JButton resetButton = null;
    public JButton getBtReset()
    {
    	return resetButton;
    }   
    private JButton cancelButton = null;
    public JButton getBtCancel()
    {
    	return cancelButton;
    }
    private JButton btFireStaff = null;


    public JFrame getJFrame()
    {
            if (jFrame == null)
            {
                    jFrame = new JFrame();
                    jFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    jFrame.setSize(450, 700);
                    jFrame.setContentPane(getJContentPane());
                    jFrame.setTitle("Project Edit");
                    jFrame.setLocationRelativeTo(null);
            }
            return jFrame;
    }

    private JPanel getJContentPane()
    {
            if (jContentPane == null)
            {
                    headingLabel = new JLabel();
                    headingLabel.setBounds(new Rectangle(10, 10, 189, 20));
                    headingLabel.setText("Project Upload/Edit");
                   
                    headingLabel_2 = new JLabel();
                    headingLabel_2.setBounds(new Rectangle(10, 40, 189, 20));
                    headingLabel_2.setText("Project ID:");
                   
                    project_id_TextField = new JTextField();
                    project_id_TextField.setBounds(200, 40, 50, 20);
                    project_id_TextField.setEnabled(false);
                   
                    headingLabel_3 = new JLabel();
                    headingLabel_3.setBounds(new Rectangle(10, 65, 189, 20));
                    headingLabel_3.setText("Project Title:");
                   
                    title_TextField = new JTextField();
                    title_TextField.setBounds(200, 65, 200, 20);
                   
                    headingLabel_4 = new JLabel();
                    headingLabel_4.setBounds(new Rectangle(10, 90, 189, 20));
                    headingLabel_4.setText("Date Created:");
                   
                    date_created_TextField = new JTextField();
                    date_created_TextField.setBounds(200, 90, 200, 20);
                   
                    headingLabel_5 = new JLabel();
                    headingLabel_5.setBounds(new Rectangle(10, 115, 100, 20));
                    headingLabel_5.setText("Creator Name:");
                   
                    creator_TextField = new JTextField();
                    creator_TextField.setBounds(200, 115, 200, 20);
                    creator_TextField.setEditable(false);
                    headingLabel_6 = new JLabel();
                    headingLabel_6.setBounds(new Rectangle(10, 140, 100, 20));
                    headingLabel_6.setText("Staff: ");
                   
                    staff_List = new JList();
                    staff_List.setBounds(157, 147, 200, 75);
                    JScrollPane staff_scrollPane = new JScrollPane (staff_List);
                    staff_scrollPane.setBounds(200, 140, 200, 75);
                   
                    headingLabel_7 = new JLabel();
                    headingLabel_7.setBounds(new Rectangle(10, 240, 100, 20));
                    headingLabel_7.setText("Milestones: ");
                   
                    milestones_List = new JList();
                    milestones_List.setBounds(158, 259, 200, 75);
                    JScrollPane milestones_scrollPane = new JScrollPane (milestones_List);
                    milestones_scrollPane.setBounds(200, 240, 200, 75);
                   
                    headingLabel_8 = new JLabel();
                    headingLabel_8.setBounds(new Rectangle(10, 340, 100, 20));
                    headingLabel_8.setText("#of Milestones:");
                   
                    number_milestones_TextField = new JTextField();
                    number_milestones_TextField.setBounds(200, 340, 100, 20);
                    number_milestones_TextField.setText("0");
                    number_milestones_TextField.setEnabled(false);
                   
                    headingLabel_9 = new JLabel();
                    headingLabel_9.setBounds(new Rectangle(10, 365, 100, 20));
                    headingLabel_9.setText("Deliverables:");
                   
                    deliverables_List = new JList();
                    deliverables_List.setBounds(157, 374, 200, 75);
                    JScrollPane deliverables_scrollPane = new JScrollPane (deliverables_List);
                    deliverables_scrollPane.setBounds(200, 365, 200, 75);
                   
                    headingLabel_10 = new JLabel();
                    headingLabel_10.setBounds(new Rectangle(10, 465, 200, 20));
                    headingLabel_10.setText("Total # of Deliverables:");
                   
                    number_deliverables_TextField = new JTextField();
                    number_deliverables_TextField.setBounds(200, 465, 100, 20);
                    number_deliverables_TextField.setText("0");
                    number_deliverables_TextField.setEnabled(false);
                   
                    headingLabel_11 = new JLabel();
                    headingLabel_11.setBounds(new Rectangle(10, 190, 400, 20));
                    headingLabel_11.setText("Additional Notes: ");
                   
                    additionalnotesTextArea = new JTextArea();
                    additionalnotesTextArea.setLineWrap(true);
                    additionalnotesTextArea.setBounds(new Rectangle(11, 496, 402, 100));
                    additionalnotesTextArea.setWrapStyleWord(true);
                   
                    scrollPane = new JScrollPane (additionalnotesTextArea);
                    scrollPane.setBounds(200, 190, 200, 100);
                   
                    saveButton = new JButton();
                    saveButton.setText("Save");
                    saveButton.setBounds(new Rectangle(336, 640, 80, 30));
                   
                    resetButton = new JButton();
                    resetButton.setText("Reset");
                    resetButton.setBounds(new Rectangle(103, 638, 80, 30));
                   
                    cancelButton = new JButton();
                    cancelButton.setText("Cancel");
                    cancelButton.setBounds(new Rectangle(14, 640, 80, 30));
                    cancelButton.addActionListener(new ActionListener()
                    {
                            public void actionPerformed(ActionEvent e)
                            {
                                    cancelWindow();
                                   
                            }      
                    });
                   
                    jContentPane = new JPanel();
                    jContentPane.setLayout(null);
                    jContentPane.add(headingLabel, null);
                    jContentPane.add(headingLabel_2, null);
                    jContentPane.add(headingLabel_3, null);
                    jContentPane.add(headingLabel_4, null);
                    jContentPane.add(headingLabel_5, null);
                    jContentPane.add(headingLabel_6, null);
                    jContentPane.add(headingLabel_7, null);
                    jContentPane.add(headingLabel_8, null);
                    jContentPane.add(headingLabel_9, null);
                    jContentPane.add(headingLabel_10, null);
                    jContentPane.add(project_id_TextField, null);
                    jContentPane.add(title_TextField, null);
                    jContentPane.add(date_created_TextField, null);
                    jContentPane.add(creator_TextField, null);
                    jContentPane.add(number_milestones_TextField, null);
                    jContentPane.add(number_deliverables_TextField, null);
                    jContentPane.add(staff_List, null);
                    jContentPane.add(milestones_List, null);
                    jContentPane.add(deliverables_List, null);
                    //jContentPane.add(scrollPane, null);
                    jContentPane.add(saveButton, null);
                    jContentPane.add(cancelButton, null);
                    jContentPane.add(resetButton, null);
                    jContentPane.add(getBtFireStaff(), null);
                    //jContentPane.add(saveButton, null);
                    jContentPane.add(additionalnotesTextArea, null);
                    //jContentPane.add(resetButton, null);
                    //jContentPane.add(cancelButton, null);
            }
            return jContentPane;
    }

    private void cancelWindow()
    {
            jFrame.setVisible(false);
            jFrame.dispose();
    }

    /**
     * This method initializes btFireStaff  
     *      
     * @return javax.swing.JButton  
     */
    public JButton getBtFireStaff() {
            if (btFireStaff == null) {
                    btFireStaff = new JButton();
                    btFireStaff.setBounds(new Rectangle(11, 196, 102, 29));
                    btFireStaff.setText("Fire Staff");
                    btFireStaff.setActionCommand("Fire Staff");
            }
            return btFireStaff;
    }

	public JList getActors() {
		return staff_List;
	}
}

